New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

net-retry-connect

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

net-retry-connect

Attempt to connect to net Sockets using retry patterns

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
48
decreased by-18.64%
Maintainers
1
Weekly downloads
 
Created
Source

net-retry-connect

Attempt to connect to net Sockets using retry patterns.

net-retry-connect is based on the Node.js net module as well as the retry module.

Installation

npm install net-retry-connect --save

API

retryConnect.to(options, callback)

options provides this options:

  • port: the TCP port
  • host: optional, defaults to 'localhost'
  • retryOptions, optional, see retry options for retry.operation

callback returns a client object if connection has been successful. Otherwise it returns the error.

var retryConnect = require('net-retry-connect');
retryConnect.to({port: 3000, host: 'localhost'}, function (error, client) {
    // use the client
});
Usage of retryOptions
var retryConnect = require('net-retry-connect');

// retry for 2 seconds only
var retryOptions = {
  retries: 2,
  factor: 1
};

retryConnect.to({port: 3000, host: 'localhost', retryOptions: retryOptions }, function (error, client) {
    // use the client
});

Running the tests:

npm install   
npm test

Keywords

FAQs

Package last updated on 29 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc